package org.springframework.demo4to1;

import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class Demo4to1 {

	public static void main(String[] args) throws IOException {
//		PathMatchingResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver();
//		Resource resource = patternResolver.getResource("test.properties");

		DefaultResourceLoader resourceLoader=new DefaultResourceLoader();
		Resource resource = resourceLoader.getResource("test.properties");

		Properties properties = new Properties();
		properties.load(resource.getInputStream());
		String username = properties.getProperty("username");
		System.out.println(username);




	}
}
